import 'osc_notice.dart';

class OscUserInfoEntity {
	int gender;//性别：1-男，2-女
	String city;//城市
	String joinTime;//加入时间
	String ident;//用户 Ident
	List<String> expertise;//专长领域
	String portrait;//头像
	int relation;//0:黑名单,1:相互关注, 2:关注, 3:粉丝, 4:无
	List<String> platforms;//开发平台
	int uid;//被查询用户id
	String lastLoginTime;//最近登录时间
	String province;//省份
	String name;//用户名称

	int fansCount;//粉丝数
	int followersCount;//关注数
	int favoriteCount;//收藏数

	OscNotice notice;//新消息

	OscUserInfoEntity({this.gender, this.city, this.joinTime, this.ident, this.expertise, this.portrait, this.relation, this.platforms, this.uid, this.lastLoginTime, this.province, this.name, this.notice});

	OscUserInfoEntity.fromJson(Map<String, dynamic> json) {
		gender = json['gender'];
		city = json['city'];
		joinTime = json['joinTime'];
		ident = json['ident'];
		expertise = json['expertise']?.cast<String>();
		portrait = json['portrait'];
		relation = json['relation'];
		platforms = json['platforms']?.cast<String>();
		uid = json['uid'];
		lastLoginTime = json['lastLoginTime'];
		province = json['province'];
		name = json['name'];
		fansCount = json['fansCount'];
		followersCount = json['followersCount'];
		favoriteCount = json['favoriteCount'];
		notice = json['notice'] != null ? new OscNotice.fromJson(json['notice']) : null;
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['gender'] = this.gender;
		data['city'] = this.city;
		data['joinTime'] = this.joinTime;
		data['ident'] = this.ident;
		data['expertise'] = this.expertise;
		data['portrait'] = this.portrait;
		data['relation'] = this.relation;
		data['platforms'] = this.platforms;
		data['uid'] = this.uid;
		data['lastLoginTime'] = this.lastLoginTime;
		data['province'] = this.province;
		data['name'] = this.name;
		data['fansCount'] = fansCount;
		data['followersCount'] = followersCount;
		data['favoriteCount'] = favoriteCount;
		if (this.notice != null) {
      data['notice'] = this.notice.toJson();
    }
		return data;
	}
}
